import type { PageParams, PageResult } from '@/types/gobal'
import { type BannerItem, type CategoryItem, type GuessItem, type HotItem } from '@/types/home'
import { http } from '@/utils/http'
// 首页广告区域接口
export const getHomebannerAPI = (distributionSite = 1) => {
  return http<BannerItem[]>({
    method: 'GET',
    url: '/home/banner',
    data: {
      distributionSite,
    },
  })
}
// /home/category/mutli
// 小程序查询前台分类，只查询一级类目信息（此处pc和app、mini共用了一套前台类目信息）
export const getHomeCategoryAPI = () => {
  return http<CategoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}

// 首页-热门推荐-小程序
// GET/home/hot/mutli
export const getHotPanelAPI = () => {
  return http<HotItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}
// 猜你喜欢-小程序
// GET/home/goods/guessLike
export const guessLikeAPI = (data?: PageParams) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}
